// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   check_serial_number_ok.java

package stock.gather;

import include.nseer_db.nseer_db_backup1;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class check_serial_number_ok extends HttpServlet
{

	public check_serial_number_ok()
	{
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		javax.servlet.ServletContext dbApplication = dbSession.getServletContext();
		HttpSession session = request.getSession();
		nseer_db_backup1 stock_db = new nseer_db_backup1(dbApplication);
		try
		{
			if (stock_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				String gather_ID = request.getParameter("gather_ID");
				String product_ID = request.getParameter("product_ID");
				String stock_ID = request.getParameter("stock_ID");
				String serial_number = request.getParameter("serial_number");
				String sql = (new StringBuilder("update stock_paying_gathering set serial_number='")).append(serial_number).append("' where gather_ID='").append(gather_ID).append("' and product_ID='").append(product_ID).append("' and stock_ID='").append(stock_ID).append("' and check_tag='0'").toString();
				stock_db.executeUpdate(sql);
				stock_db.commit();
				stock_db.close();
				response.sendRedirect((new StringBuilder("stock/gather/check.jsp?gather_ID=")).append(gather_ID).toString());
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
